/**
 * 
 */
package com.roshan.web.security.domain.type;

/**
 * Enum which defined the status of the MFA cookie token.
 * 
 * @author roshan
 * 
 */
@SuppressWarnings("nls")
public enum MFAStatus {

    /**
     * 
     * The Initial Status.
     */
    INIT(1),

    /**
     * The Ready Status.
     */
    READY(2),

    /**
     * The Authenticated Status.
     */
    AUTHENTICATED(3);

    /** The value code. */
    private final int value;

    /**
     * Instantiates a new mfa cookie status.
     * 
     * @param value the value
     */
    private MFAStatus(int value) {
        this.value = value;
    }

    /**
     * Gets the value.
     * 
     * @return the value
     */
    public int getValue() {
        return this.value;
    }

    /**
     * Returns the enum matching for the value passed.
     * 
     * @param value field
     * @return the CheckoutTokenStatus enum
     */
    public static MFAStatus valueOf(int value) {
        for (MFAStatus type : values()) {
            if (type.value == value) {
                return type;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + value + "]");
    }

}
